home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWIdle.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.6 KB  |  98 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWIdle.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWIDLE_H
  11. #define FWIDLE_H
  12.  
  13. // ----- Foundation Includes -----
  14.  
  15. #ifndef FWRUNTYP_H
  16. #include "FWRunTyp.h"
  17. #endif
  18.  
  19. #ifndef FWEXCLIB_H
  20. #include "FWExcLib.h"
  21. #endif
  22.  
  23. #ifndef FWSTDDEF_H
  24. #include "FWStdDef.h"
  25. #endif
  26.  
  27. // ----- OpenDoc Includes -----
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class FW_CPart;
  38. class FW_CFrame;
  39. class ODDispatcher;
  40. class ODFrame;
  41.  
  42. //========================================================================================
  43. // class FW_CIdler
  44. //========================================================================================
  45.  
  46. class FW_CIdler
  47. {
  48. public:
  49.     FW_DECLARE_AUTO(FW_CIdler)
  50.     
  51. //----------------------------------------------------------------------------------------
  52. //    Initialization/Destruction
  53. //
  54. public:
  55.     FW_CIdler(FW_CPart* part, ODIdleFrequency frequency);
  56.     FW_CIdler(FW_CFrame* frame, ODIdleFrequency frequency);
  57.     ~FW_CIdler();
  58.  
  59. //----------------------------------------------------------------------------------------
  60. //    API
  61. //
  62. public:
  63.     void                 SetIdleFrequency(Environment *ev, ODIdleFrequency frequency);
  64.     FW_Boolean            IsRegistered(Environment *ev) const;
  65.  
  66.     void                 RegisterIdle(Environment *ev, FW_Boolean state);
  67.     void                 RegisterIdle(Environment *ev);
  68.     void                 UnregisterIdle(Environment *ev);
  69.  
  70. private:
  71.     void                PrivSetIdleFrequency(Environment *ev, ODIdleFrequency frequency);
  72.     ODDispatcher*        PrivGetDispatcher(Environment *ev) const;
  73.     ODFrame*            PrivGetRegisteredFrame(Environment *ev) const;
  74.     
  75. //----------------------------------------------------------------------------------------
  76. //    Data Members
  77. //
  78. private:
  79.     FW_Boolean        fRegistered;
  80.     ODIdleFrequency    fFrequency;
  81.     FW_CPart*        fPart;
  82.     FW_CFrame*        fFrame;
  83. };
  84.  
  85. //========================================================================================
  86. //     inlines
  87. //========================================================================================
  88.  
  89. //----------------------------------------------------------------------------------------
  90. //    FW_CIdler::IsRegistered
  91. //----------------------------------------------------------------------------------------
  92.  
  93. inline FW_Boolean FW_CIdler::IsRegistered(Environment*) const
  94. {
  95.     return fRegistered;
  96. }
  97.  
  98. #endif